<script type="text/javascript">
var _d = DialogManager.get('config_dialog');
_d.setWidth(540);
_d.setPosition('center');
$(function(){
	$("select[name='img_recom_id']").change(function(){
		switchRecommend(this.value, 'img_cate_id');
	});
	switchRecommend($("select[name='img_recom_id']").val(), 'img_cate_id');
});
function switchRecommend(recomId, selectName)
{
    if (recomId >= 0)
    {
        $("select[name='" + selectName + "']").hide();
    }
    else
    {
        $("select[name='" + selectName + "']").show();
    }
}
</script>
<div class="field_item webkit-box">
    <label>模块名称</label>
    <p><input type="text" name="model_name" value="{$options.model_name}"/></p>
</div>
<div class="field_item webkit-box">
	<label>显示数量</label>
    <p><input type="text" name="num" value="{$options.num}" /></p>
</div>
<div class="field_item webkit-box box-align-center">
    <label>商品数据</label>
    <p><select name="img_recom_id">
        <option value="0">请选择...</option>
        <!-- {foreach from=$recommends key=recom_id item=recom_name} -->
        <option value="{$recom_id}"{if $options.img_recom_id eq $recom_id} selected="selected"{/if}>{$recom_name|escape}</option>
        <!-- {/foreach} -->
    </select>
    <select name="img_cate_id">
        <option value="0">请选择分类...</option>
        {html_options options=$gcategories selected=$options.img_cate_id}
    </select></p>
    <font class="ml10 fs12" color="gray">默认读取限时打折的商品</font>
</div>